let myObj = {
    name: 'jht',
    job: '前端工程师'
}

function defineProperty(data, key, value) {
    Object.defineProperty(data, key, {
        get: function () {
            return value
        },
        set: function(newValue) {
            console.log('newValue:', newValue);
            console.log('this:', this);
            value = newValue
        }
    })
}

defineProperty(myObj, 'name', 'zy')
myObj.name = 'zy'
console.log('执行了！！！');